#!/bin/bash

  fitnesse_dir=./target
  fitnesse_lib_dir=${fitnesse_dir}/lib
  test_classes=${fitnesse_dir}/test-classes
  fitnesse_port=6767

  mvn clean install
  mvn dependency:copy-dependencies -DoutputDirectory=${fitnesse_lib_dir}	

  all_libs=`find ${fitnesse_lib_dir} | xargs | sed -e "s| |:|g"`
  full_classpath="$test_classes:$all_libs"	

  args=" -Dtestclasspath=$full_classpath" # not clear where to use

 java -Xmx128m -Xms128m \
    -cp $full_classpath \
    $args fitnesseMain.FitNesseMain \
      -p $fitnesse_port \
      -e 9 \
      -d "${test_classes}" \
      
# -Xdebug
# -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n \
# -l ${fitnesse_log_dir}
# what does it mean -e 9?
